<?php
ob_start();

function __autoload($class_name) {
include './'.$class_name . '.php';
}

$email = $_POST['email'];
$name = $_POST['name'];
$message = $_POST['message'];

$sender = "contact@blivebird.com";
$sendMailSender = new SendMail();
$sendMailSender->setSenderAddress($sender);
$sendMailSender->setRecipientAddress($email);
$sendMailSender->setSubject("Thank You for Contacting Us");
$body="<html><body style='font-family:Verdana;'> Hello ". $name .",<br/><br/> Thank you for interest.<br/><br/> We will get back to you as soon as possible<br/><br/>Thanks and Regards<br/>Blivebird Team</body></html>";
$sendMailSender->setEmailBody($body);
$sendMailSender->sendMail();

$internalEmail = "abhirup.bose@blivebird.com";
$sendMailInternal = new SendMail();
$sendMailInternal->setSenderAddress($email);
$sendMailInternal->setRecipientAddress($internalEmail);
$sendMailInternal->setSubject('Request for Information from '.$name);
$sendMailInternal->setEmailBody($message + "Email" + $email);
$sendMailInternal->sendMail();

$results = array();
$results['success'] = true;
echo json_encode($results);;
ob_end_flush();
?>
